import '../item_style.dart';
import '../tooltip.dart';
import 'series.dart';

import 'package:json_annotation/json_annotation.dart';

part 'heatmap_series.g.dart';

@JsonSerializable(includeIfNull: false, explicitToJson: true)
class HeatMapEmphasis {
  var focus;
  var blurScope;
  ItemStyle? itemStyle;
  SeriesLabel? label;

  HeatMapEmphasis({this.focus, this.blurScope, this.itemStyle, this.label});

  factory HeatMapEmphasis.fromJson(Map<String, dynamic> json) =>
      _$HeatMapEmphasisFromJson(json);

  Map<String, dynamic> toJson() => _$HeatMapEmphasisToJson(this);
}

@JsonSerializable(includeIfNull: false, explicitToJson: true)
class HeatMapBlurSelectEmphasis {
  ItemStyle? itemStyle;
  SeriesLabel? label;

  HeatMapBlurSelectEmphasis({this.itemStyle, this.label});

  factory HeatMapBlurSelectEmphasis.fromJson(Map<String, dynamic> json) =>
      _$HeatMapBlurSelectEmphasisFromJson(json);

  Map<String, dynamic> toJson() => _$HeatMapBlurSelectEmphasisToJson(this);
}

@JsonSerializable(includeIfNull: false, explicitToJson: true)
class HeatMapData {
  var name;
  var value;
  SeriesLabel? label;
  ItemStyle? itemStyle;
  HeatMapBlurSelectEmphasis? emphasis;

  HeatMapData({
    this.name,
    this.value,
    this.label,
    this.itemStyle,
    this.emphasis,
  });

  factory HeatMapData.fromJson(Map<String, dynamic> json) =>
      _$HeatMapDataFromJson(json);

  Map<String, dynamic> toJson() => _$HeatMapDataToJson(this);
}

@JsonSerializable(includeIfNull: false, explicitToJson: true)
class HeatMapSeries extends Series {
  var type = 'heatmap';
  var id;
  var name;

  var coordinateSystem;
  var xAxisIndex;
  var yAxisIndex;
  var geoIndex;
  var calendarIndex;
  var pointSize;
  var blurSize;
  var minOpacity;
  var maxOpacity;
  var progressive;
  var progressiveThreshold;

  SeriesLabel? label;
  LabelLayout? labelLayout;
  SeriesItemStyle? itemStyle;

  HeatMapEmphasis? emphasis;

  HeatMapBlurSelectEmphasis? blur;

  HeatMapBlurSelectEmphasis? select;

  var selectedMode;

  List<HeatMapData>? data;
  MarkPoint? markPoint;
  MarkLine? markLine;
  MarkArea? markArea;

  var zlevel;
  var z;
  var silent;

  Tooltip? tooltip;

  HeatMapSeries(
      {this.id,
      this.name,
      this.coordinateSystem,
      this.xAxisIndex,
      this.yAxisIndex,
      this.geoIndex,
      this.calendarIndex,
      this.pointSize,
      this.blurSize,
      this.minOpacity,
      this.maxOpacity,
      this.progressive,
      this.progressiveThreshold,
      this.label,
      this.labelLayout,
      this.itemStyle,
      this.emphasis,
      this.blur,
      this.select,
      this.selectedMode,
      this.data,
      this.markPoint,
      this.markLine,
      this.markArea,
      this.zlevel,
      this.z,
      this.silent,
      this.tooltip});

  factory HeatMapSeries.fromJson(Map<String, dynamic> json) =>
      _$HeatMapSeriesFromJson(json);

  Map<String, dynamic> toJson() => _$HeatMapSeriesToJson(this);
}
